import ajax from '@/utils/request'
// 获取字典内容
export function getDictionary(data) {
	// 传入的data对象  {ip:'121.00.00.01'};
	return ajax({
		url: '/dictionary/get',
		method: 'GET',
		data
	})
}
// post请求
export function postData(data) {
	// 传入的data对象  {ip:'xxxxxx'};
	return ajax({
		url: '/ip/getIpInfo.php',
		method: 'POST',
		data
	})
}
// put请求
export function putData(data) {
	// 传入的data对象  {ip:'xxxxxx'};
	//put方法大部分会以拼接地址的形式使用 如:request.put("/test/getInfo.php?id="+4)
	return ajax({
		url: '/ip/getIpInfo.php',
		method: 'PUT',
		data
	})
}
// delete请求
export function deleteData(data) {
	// 传入的data对象  {ip:'xxxxxx'};
	//delete方法大部分会以拼接地址的形式使用 如:request.delete("/test/getInfo.php?id="+4)
	return ajax({
		url: '/ip/getIpInfo.php',
		method: 'DELETE',
		data
	})
}

// 注册
export function register(data) {
	// 传入的data对象  {ip:'xxxxxx'};
	return ajax({
		url: '/mobile/register',
		method: 'POST',
		data
	})
}

//发送验证码
export function sendCode(data) {
	// 传入的data对象  {ip:'xxxxxx'};
	return ajax({
		url: '/mobile/sendCode',
		method: 'GET',
		data
	})
}

// 登录
export function login(data) {
	return ajax({
		url: '/mobile/login',
		method: 'POST',
		data
	})
}

export function updateInstructorInfo(data) {
	return ajax({
		url: '/mobile/updateInstructorInfo',
		method: 'POST',
		data
	})
}

export function getGameDetail(data) {
	return ajax({
		url: '/mobile/student/index/article/detail/' + data.id,
		method: 'GET',
		data
	})
}

export function getGamePraise(id) {
	return ajax({
		url: '/mobile/student/index/article/praise/' + id,
		method: 'GET'
	})
}


// 获取近期赛事
export function getGame(data) {
	return ajax({
		url: '/mobile/student/index/articles',
		method: 'GET',
		data
	})
}
//获取即将训练课程
export function getCourse(data) {
	return ajax({
		url: '/mobile/student/index/myCourse',
		method: 'GET',
		data
	})
}
// 获取近期完成的训练课程
export function getFinishCourse(data) {
	return ajax({
		url: '/mobile/student/index/finishCourse',
		method: 'GET',
		data
	})
}

// 获取近期完成的训练课程
export function getStudentPlanList(data) {
	return ajax({
		url: '/storehouse/coursePlanOnlyStu',
		method: 'GET',
		data
	})
}
// 获取我的教练
export function getCoach(data) {
	return ajax({
		url: '/mobile/student/index/myInstructor',
		method: 'GET',
		data
	})
}
// 获取体系课
export function getOpenCourse(data) {
	return ajax({
		url: '/mobile/student/index/openCourse',
		method: 'GET',
		data
	})
}
// 兑换体系课
export function exchangeOpenCourse(id) {
	return ajax({
		url: `/storehouse/packagePage/buy/${id}/2`,
		method: 'POST'
	})
}
// 获取已兑换体系课列表
export function getMyOpenCourse(data) {
	return ajax({
		url: '/storehouse/buys/packagePage',
		method: 'GET',
		data
	})
}
// 获取当前登录用户信息
export function getUser(data) {
	return ajax({
		url: '/mobile/userInfo',
		method: 'GET',
		data
	})
}
// 获取微信小程序 unionid
export function getUnionIdWithMiniProgram(data) {
	return ajax({
		url: '/mobile/getUnionIdWithMiniProgram',
		method: 'GET',
		data
	})
}
// 微信授权登录
export function loginWithMiniProgram(data) {
	return ajax({
		url: '/mobile/loginWithMiniProgram',
		method: 'GET',
		data
	})
}
// 微信小程序用户绑定账号
export function bindWxMp(data) {
	return ajax({
		url: '/mobile/bindWxMp',
		method: 'GET',
		data
	})
}

//我的训练总计
export function myCourse_center(data) {
	return ajax({
		url: '/mobile/student/center/myCourse',
		method: 'GET',
		data
	})
}

//添加计分记录
export function scoreRecord(data) {
	return ajax({
		url: '/mobile/student/index/scoreRecord',
		method: 'POST',
		data
	})
}

//教练详情
export function coachDetail(id) {
	return ajax({
		url: '/mobile/student/index/instructor/detail/' + id,
		method: 'GET'
	})
}

// 邀请信息教练详情
export function bindInstructorInfo(data) {
	return ajax({
		url: '/mobile/instructor/stu/stu/bindInstructorInfo',
		method: 'GET',
		data
	})
}

// 绑定教练
export function bindCaoch(data) {
	return ajax({
		url: '/mobile/instructor/stu/stu/bindStu',
		method: 'GET',
		data
	})
}

// 历史计分
export function historyPlay(data) {
	return ajax({
		url: '/mobile/student/index/scoreRecord/page',
		method: 'GET',
		data
	})
}

// 计分详情
export function playDetail(data) {
	return ajax({
		url: '/mobile/student/index/scoreRecord/' + data,
		method: 'GET'
	})
}

// 我的测评统计
export function evaluationStatistics(data) {
	return ajax({
		url: '/mobile/stu/evaluation/statistics',
		method: 'GET',
		data
	})
}

// 获取所有体系课
export function storehouseAllPackagePage(data) {
	return ajax({
		url: '/storehouse/allPackagePage',
		method: 'GET',
		data
	})
}

// 获取体系课标签
export function getTag() {
	return ajax({
		url: '/dictionary/get?name=open_class_tags',
		method: 'GET'
	})
}

// 训练时间
export function getTrainCourse(data) {
	return ajax({
		url: '/mobile/student/center/coursePage',
		method: 'GET',
		data
	})
}

// 编辑用户昵称
export function userInfoSubmit(data) {
	return ajax({
		url: '/mobile/instructor/center/userInfoSubmit',
		method: 'POST',
		data
	})
}

//获取审核信息
export function userInfoCheck() {
	return ajax({
		url: '/mobile/instructor/center/userInfoCheck',
		method: 'GET'
	})
}

// 私教课列表
export function courseOnlyStu(data) {
	return ajax({
		url: '/storehouse/courseOnlyStu',
		method: 'GET',
		data
	})
}
// 私教课详情
export function courseOnlyStuDetail(id) {
	return ajax({
		url: '/storehouse/courseStudentDetailWithId/' + id,
		method: 'GET'
	})
}
// 获取设置
export function setting(data) {
	return ajax({
		url: '/mobile/setting',
		method: 'GET',
		data
	})
}
// 删除账号
export function removeAccount() {
	return ajax({
		url: '/mobile/tempDelMe',
		method: 'GET'
	})

}
// 提问列表
export function getQuestionsList(data) {
	return ajax({
		url: '/storehouse/traineesPage',
		method: 'GET',
		data
	})

}
// 创建问题
export function createProblem(data) {
	return ajax({
		url: '/storehouse/addStuTrainees',
		method: 'POST',
		data
	})

}

// 签到总数
export function getSignCount(data) {
	return ajax({
		url: '/mobile/instructor/center/signCount',
		method: 'GET',
		data
	})
}

// 点击签到
export function signNow() {
	return ajax({
		url: '/mobile/instructor/center/sign',
		method: 'GET'
	})
}

// 签到任务列表
export function signTaskList() {
	return ajax({
		url: '/mobile/student/center/taskList',
		method: 'GET'
	})
}
// 分享app 成功
export function appShareScuess() {
	return ajax({
		url: '/mobile/instructor/center/share',
		method: 'GET'
	})
}

// 获取一对一答疑数据
export function getQaList(data) {
	return ajax({
		url: '/mobile/student/index/qaList',
		method: 'GET',
		data
	})
}
//用分类获取教练
export function qaInstructor(data) {
	return ajax({
		url: '/mobile/student/index/qaInstructor',
		method: 'GET',
		data
	})
}
//字典教练分类
export function learn_focus() {
	return ajax({
		url: '/dictionary/get?name=learn_focus',
		method: 'GET'
	})
}
//创建im群聊
export function createlmGroup(data) {
	return ajax({
		url: '/mobile/student/index/createImGroup/'+data,
		method: 'GET',
	})
}
//拒绝im好友请求
export function delFriendInvite(data) {
	return ajax({
		url: '/mobile/im/delFriendInvite/'+data,
		method: 'GET',
	})
}